package gestionColis;

/**
 * Interface definition : GestBancaire
 * 
 * @author OpenORB Compiler
 */
public abstract class GestBancairePOA extends org.omg.PortableServer.Servant
        implements GestBancaireOperations, org.omg.CORBA.portable.InvokeHandler
{
    public GestBancaire _this()
    {
        return GestBancaireHelper.narrow(_this_object());
    }

    public GestBancaire _this(org.omg.CORBA.ORB orb)
    {
        return GestBancaireHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:gestionColis/GestBancaire:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("creationCompte")) {
                return _invoke_creationCompte(_is, handler);
        } else if (opName.equals("crediter")) {
                return _invoke_crediter(_is, handler);
        } else if (opName.equals("debiter")) {
                return _invoke_debiter(_is, handler);
        } else if (opName.equals("verificationSolde")) {
                return _invoke_verificationSolde(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_creationCompte(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        gestionColis.InfoAdherent arg0_in = gestionColis.InfoAdherentHelper.read(_is);

        try
        {
            creationCompte(arg0_in);

            _output = handler.createReply();

        }
        catch (gestionColis.InfoAdherentInvalideException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.InfoAdherentInvalideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_crediter(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        gestionColis.InfoTransaction arg0_in = gestionColis.InfoTransactionHelper.read(_is);

        try
        {
            crediter(arg0_in);

            _output = handler.createReply();

        }
        catch (gestionColis.AdherentInconnuException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.AdherentInconnuExceptionHelper.write(_output,_exception);
        }
        catch (gestionColis.MontantInvalideException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.MontantInvalideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_debiter(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        gestionColis.InfoTransaction arg0_in = gestionColis.InfoTransactionHelper.read(_is);

        try
        {
            debiter(arg0_in);

            _output = handler.createReply();

        }
        catch (gestionColis.AdherentInconnuException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.AdherentInconnuExceptionHelper.write(_output,_exception);
        }
        catch (gestionColis.MontantInvalideException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.MontantInvalideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_verificationSolde(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        gestionColis.InfoTransaction arg0_in = gestionColis.InfoTransactionHelper.read(_is);

        try
        {
            verificationSolde(arg0_in);

            _output = handler.createReply();

        }
        catch (gestionColis.AdherentInconnuException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.AdherentInconnuExceptionHelper.write(_output,_exception);
        }
        catch (gestionColis.MontantInvalideException _exception)
        {
            _output = handler.createExceptionReply();
            gestionColis.MontantInvalideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

}
